﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Linq;
using Word = Microsoft.Office.Interop.Word;
using Office = Microsoft.Office.Core;
using Microsoft.Office.Tools.Word;
using NetDimension.NanUI;
using System.IO;
using System.Windows.Forms;
using Xilium.CefGlue;

namespace NanUIforVSTODemo.WordPlugin
{
    public partial class ThisAddIn
    {


        private void ThisAddIn_Startup(object sender, System.EventArgs e)
        {
            WinFormium.CreateRuntimeBuilder(env => {
                env.UseExternalSubprocess(cfg =>
                {
                    cfg.UseCustomSubprocessPath(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "NanUISubprocess.exe"));

                });
            }, app => {


                app.UseApplicationContext(() =>
                {
                    return new ApplicationContext();
                });

            }).Build().Run();

        }

        private void ThisAddIn_Shutdown(object sender, System.EventArgs e)
        {

        }

        #region VSTO 生成的代码

        /// <summary>
        /// 设计器支持所需的方法 - 不要修改
        /// 使用代码编辑器修改此方法的内容。
        /// </summary>
        private void InternalStartup()
        {
            this.Startup += new System.EventHandler(ThisAddIn_Startup);
            this.Shutdown += new System.EventHandler(ThisAddIn_Shutdown);

        }

        #endregion
    }
}
